cd "......" // Please replace ...... with the pyth of the folder

global fe gvkey fyear
global cluster gvkey 
global controls log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth
use  full_data, clear 

/*-----------------------------------------------------------------------------*/
   /* [>   Table 1.  Summary statistics   <] */ 
/*----------------------------------------------------------------------------*/
/* [> Panel A: Summary statistics <] */ 
reghdfe log_ttl_pat_cpc_adj    align_pi_amt_ea_dum_2  ${controls} ${years}, absorb(sic3 fyear) cluster($cluster)
gen sample = e(sample)

global vars  ${controls}  align_pi_amt_ea_dum_2 log_ttl_pat_cpc_adj  log_ttl_cite_cpc_adj1 log_ttl_xi_real    log_ttl_originality_cpc log_ttl_generality_cpc  explore_pct_20_new exploit_pct_20_new  log_avg_pat_valu    log_rd_cite_cpc_adj1 log_cite_emp_cpc_adj1 

tabstat $vars if sample, stats( mean sd  p25 p50 p75   ) c(s) f(%6.3f) save

/* [> Panel B: Distribution of firms with partisan aligned managers by state <] */ 
tabstat  align_pi_amt_ea_dum_2 , by(STATE) c(s) s(sum mean)

/* [> Panel C: Distribution of firms with partisan aligned managers by industry <] */ 
tabstat  align_pi_amt_ea_dum_2 if sample, by(ff12) c(s) s(sum mean)


foreach v in log_ttl_pat_cpc_adj  log_ttl_cite_cpc_adj1 log_ttl_xi_real{
        ttest `v' if sample , by (align_pi_amt_ea_dum_2) welch          
}

/*-----------------------------------------------------------------------------*/
   /* [>   Table 2.  Partisan Aligned Managers and Corporate Innovation   <] */ 
/*----------------------------------------------------------------------------*/
/* [> Panel A. Firm Fixed Effects <] */ 
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'     
esttab  a* using Table2.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel A. Firm Fixed Effects) 

/* [> Panel B. Industry Fixed Effects <] */ 

est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls}  , absorb(sic3 fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  , absorb(sic3 fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  , absorb(sic3 fyear) cluster($cluster)
    est store a`++i'
esttab  a* using Table2.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel B. Industry Fixed Effects ) 

/* [> Panel C. Firm Fixed Effects and Industry Year Fixed Effects <] */ 
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey indu_year) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey indu_year ) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  , absorb( gvkey indu_year) cluster($cluster)
    est store a`++i'
esttab  a* using Table2.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel C. Firm Fixed Effects and Industry Year Fixed Effects ) 

/* [> Panel D. Nonconnection sample <] */ 
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls}  if nonconnection == 1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if nonconnection == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls} if nonconnection == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'     
esttab  a* using Table2.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel D. Nonconnection sample )

/*-------------------------------------------------------------------------*/
   /* [>   Table 4. Partisan Alignment and Optimism - Overconfidence   <] */ 
/*-------------------------------------------------------------------------*/
/* [> Panel A. Holder 67 <] */ 
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if holder67 == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if holder67 == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if holder67 == 1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
 reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if holder67 == 0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  if holder67 == 0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if holder67 == 0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'   
esttab  a* using Table4.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(align_pi_amt_ea_dum*)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel A. Holder 67) 


/* [> Panel B. Net Buyer <] */ 
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if net_buyer2 == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if net_buyer2 == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if net_buyer2 == 1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
 reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if net_buyer2 == 0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  if net_buyer2 == 0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if net_buyer2 == 0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'   
esttab  a* using Table4.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(align_pi_amt_ea_dum*)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel B. Net Buyer) 


/*-------------------------------------------------------------------------------------*/
   /* [>   Table 5. Partisan Alignment and Optimism – Economic Policy Uncertainty  <] */ 
/*---------------------------------------------------------------------------------------*/
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if news_epu_top == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if news_epu_top == 1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if news_epu_top == 1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
 reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if news_epu_top == 0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  if news_epu_top == 0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if news_epu_top == 0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'   

esttab  a* using Table5.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(align_pi_amt_ea_dum*)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Table 5. Partisan Alignment and Optimism - Economic Policy Uncertainty) 


/*-------------------------------------------------------------------------------*/
   /* [>   Table 6. Partisan Aligned Managers and Quality of Innovation  <] */ 
/*---------------------------------------------------------------------------------*/
est clear
local i = 1
reghdfe log_ttl_originality_cpc   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_originality_cpc   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey indu_year) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_generality_cpc   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_generality_cpc   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey indu_year) cluster($cluster)
    est store a`++i'
esttab  a* using Table6.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Table 6. Partisan Aligned Managers and Quality of Innovation) 

/*-------------------------------------------------------------------------------*/
   /* [>   Table 7. Partisan Aligned Managers and Strategy of Innovation  <] */ 
/*---------------------------------------------------------------------------------*/
est clear

local i = 1
reghdfe explore_pct_20_new   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe explore_pct_20_new   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey indu_year) cluster($cluster)
    est store a`++i'
reghdfe exploit_pct_20_new   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe exploit_pct_20_new   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey indu_year) cluster($cluster)
    est store a`++i'
esttab  a* using Table7.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Table 7. Partisan Aligned Managers and Strategy of Innovation) 


/*------------------------------------------------------------------------------------*/
   /* [>   Table 8. Partisan aligned managers versus partisan aligned inventors. <] */ 
/*------------------------------------------------------------------------------------*/
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj  align_pi_amt_ea_dum_2 Aligned_Inventor log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1  align_pi_amt_ea_dum_2 Aligned_Inventor log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_xi_real  align_pi_amt_ea_dum_2 Aligned_Inventor log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using Table8.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel A: Controlling for partisan aligned inventors) 

est clear
local i = 1
reghdfe LOG_RD_EXP align_pi_amt_ea_dum_2 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe INNOVATION_CULTURE align_pi_amt_ea_dum_2 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow sales_growth rd_s, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using Table8.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel B: Managerial decisions related to innovation) 
    
    



/*---------------------------------------------------------------*/
   /* [>   Table A4. Alternative Measures of Firm Innovation  <] */ 
/*---------------------------------------------------------------*/
est clear
local i = 1
reghdfe log_avg_pat_valu   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_rd_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_cite_emp_cpc_adj1   align_pi_amt_ea_dum_2   ${controls}  , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'

esttab  a* using TableA4.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Table A4. Alternative Measures of Quality of Innovation) 

/*--------------------------------------------------------*/
   /* [>   Table A5. Subsample of Innovative Firms  <] */ 
/*---------------------------------------------------------*/
est clear

local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if rd_a >0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if rd_a >0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if rd_a >0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'

esttab  a* using TableA5.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Table 10. Subsample of Innovative Firms) 


/*--------------------------------------------------------*/
   /* [>   Table A6. Industry Heterogeneity  <] */ 
/*---------------------------------------------------------*/

/* [> Panel A. Innovative Industry vs. Non-innovative Industry <] */ 
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if innovative_ind_med_1  ==1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if innovative_ind_med_1 ==1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if innovative_ind_med_1  ==1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if innovative_ind_med_1  ==0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if innovative_ind_med_1 ==0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if innovative_ind_med_1  ==0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'    
esttab  a* using TableA6.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(align_pi_amt_ea_dum*)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Innovative Industry vs. non-innovative industry) 


/* [> Panel B. Competitive Industries vs. Non-competitive Industries <] */ 
local i = 1
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if hhi_sic3_x2_top  ==1 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if hhi_sic3_x2_top ==1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if hhi_sic3_x2_top  ==1, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_pat_cpc_adj   align_pi_amt_ea_dum_2   ${controls} if hhi_sic3_x2_top  ==0 , absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1   align_pi_amt_ea_dum_2   ${controls} if hhi_sic3_x2_top ==0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'
reghdfe log_ttl_xi_real   align_pi_amt_ea_dum_2   ${controls}  if hhi_sic3_x2_top  ==0, absorb(gvkey fyear) cluster($cluster)
    est store a`++i'    
esttab  a* using TableA6.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(align_pi_amt_ea_dum*)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Competitive Industries vs. noncompetitive industries) 


use psm_sample, clear
/*------------------------------------------------------------------------------------------------*/
   /* [>   Table 3. Difference-in-differences (DID) estimation with propensity score matching. <] */ 
/*-------------------------------------------------------------------------------------------------*/

/* [> Panel A: Treatment year summary statistics <] */ 
foreach v in log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth log_ttl_pat_cpc_adj log_ttl_cite_cpc_adj1 log_ttl_xi_real{
    ttest `v' ,  by (treated), if relative_year==0
}  // end of foreach v in varlist

/* [> Panel B: DID <] */ 
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj c.treated##c.post log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1 c.treated##c.post log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_xi_real c.treated##c.post log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using Table3.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(treated#post)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel B:  DID) 

    
/* [> Panel C: Dynamic DID <] */ 
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj bef_3_year bef_2_year bef_1_year bef_0_year aft_1_year aft_2_year aft_3_year log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1 bef_3_year bef_2_year bef_1_year bef_0_year aft_1_year aft_2_year aft_3_year log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_xi_real bef_3_year bef_2_year bef_1_year bef_0_year aft_1_year aft_2_year aft_3_year log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using Table3.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order()  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel C: Dynamic DID) 

/*------------------------------------------------------------------------------------------------*/
   /* [>   Table A2. Difference-in-differences (DID) with additional controls. <] */ 
/*-------------------------------------------------------------------------------------------------*/
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj c.post## (c.treated c.TENURE c.FEMALE_R c.AVG_AGE) log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1 c.post## (c.treated c.TENURE c.FEMALE_R c.AVG_AGE) log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_xi_real c.post## (c.treated c.TENURE c.FEMALE_R c.AVG_AGE) log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using TableA2.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(post#treated treated )  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Table A2. Difference-in-differences (DID) with additional controls) 
    
/*------------------------------------------------------------------------------------------------------------*/
   /* [>   Table A3. Triple difference (DIDID) tests with CEO overconfidence as the third difference. <] */ 
/*------------------------------------------------------------------------------------------------------------*/
/* [> Panel A: Holder 67 <] */ 
est clear
local i = 1
reghdfe log_ttl_pat_cpc_adj c.treated##c.post##c.holder67 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1 c.treated##c.post##c.holder67 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_xi_real c.treated##c.post##c.holder67 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using TableA3.csv, replace label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(treated#post#holder67)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel A: Holder 67) 

/* [> Panel A: Net Buyer <] */ 
est clear
local i = 1    
reghdfe log_ttl_pat_cpc_adj c.treated##c.post##c.net_buyer2 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_cite_cpc_adj1 c.treated##c.post##c.net_buyer2 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
reghdfe log_ttl_xi_real c.treated##c.post##c.net_buyer2 log_asset roa_ebit m_b_1 ppe_a bdt_a cash_flow rd_s sales_growth, absorb(gvkey fyear) cluster(gvkey)
    est store a`++i'
esttab * using TableA3.csv, append label  ///
    compress nogap b(%6.3f) scalars( N r2_a)    order(treated#post#net_buyer2)  /// 
    star(* 0.1 ** 0.05 *** 0.01) obslast  drop()     ///
    title(Panel B: Net Buyer) 
    
















